home *** CD-ROM | disk | FTP | other *** search
- <%
- on error resume next
- dim SecurityBox
- if (Session("Index") <> "Index") then
- Response.Redirect "index.asp"
- elseif ((Request.Form("Add") = "Add") or (Request.Form("Modify") <> "")) then
- set SecurityBox = Server.CreateObject("AdvFusionBox.FusionBox")
- set Result = SecurityBox.GetAllSectionKeys("WebSite.ini", "Path")
- if (SecurityBox.IsError = 1) then
- Session("Error") = SecurityBox.ErrorReason
- set SecurityBox = nothing
- Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
- end if
- for each Member in Result
- if (rtrim(ltrim(Request.Form("WebSiteName"))) = Member.Key) then
- Session("Error") = "ASPFusion Security Box with name "&Request.Form("WebSiteName")&" already exist, please supply another name"
- set Result = nothing
- set SecurityBox = nothing
- Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
- end if
- next
- set Result = nothing
- set Rst = SecurityBox.GetRegVal("", "InstallationPath", "String")
- if (SecurityBox.IsError = 1) then
- Session("Error") = SecurityBox.ErrorReason
- set SecurityBox = nothing
- Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
- end if
- set Result = SecurityBox.ReturnValues("Admin.ini", "Settings", "Applied")
- if (SecurityBox.IsError = 1) then
- Session("Error") = SecurityBox.ErrorReason
- set Rst = nothing
- set SecurityBox = nothing
- Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
- end if
- set File = Server.CreateObject("Scripting.FileSystemObject")
- DspText = ""
- ActText = vbCrLf & "%" & ">"
- JSCodeText = ""
- for each Member in Result
- DspFileName = Rst.Value & "\Admin\dsp_" & Member.Value & ".asp"
- ActFileName = Rst.Value & "\Admin\act_" & Member.Value & ".asp"
- if (File.FileExists(DspFileName) and File.FileExists(ActFileName)) then
- DspText = DspText & vbCrLf & "<!--- #include file = 'dsp_" & Member.Value & ".asp' --->"
- ActText = ActText & vbCrLf & "<!--- #include file = 'act_" & Member.Value & ".asp' --->"
- JSCodeText = JSCodeText & vbCrLf & "if (!" & LCase(Member.Value) & "()) return false;"
- end if
- next
- set Result = nothing
- set File = nothing
- ActText = ActText & vbCrLf & "<" & "%"
- SecurityBox.Insert Rst.Value & "\Admin\dsp_websitesecuritydetail.asp", DspText, "<!--- ASP Include Start Mark --->", "<!--- ASP Include End Mark --->"
- if (SecurityBox.IsError = 1) then
- Session("Error") = SecurityBox.ErrorReason
- set Rst = nothing
- set SecurityBox = nothing
- Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
- end if
- SecurityBox.Insert Rst.Value & "\Admin\act_websitesecuritydetail.asp", ActText, "'ASP Include Start Mark", "'ASP Include End Mark"
- if (SecurityBox.IsError = 1) then
- Session("Error") = SecurityBox.ErrorReason
- set Rst = nothing
- set SecurityBox = nothing
- Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
- end if
- SecurityBox.Insert Rst.Value & "\Admin\act_websitesecuritydetail.asp", ActText, "'ASP Include Start Mark1", "'ASP Include End Mark1"
- if (SecurityBox.IsError = 1) then
- Session("Error") = SecurityBox.ErrorReason
- set Rst = nothing
- set SecurityBox = nothing
- Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
- end if
- SecurityBox.Insert Rst.Value & "\Admin\index.js", JSCodeText, "/* JS Code Start Mark1 */", "/* JS Code End Mark1 */"
- set Rst = nothing
- if (SecurityBox.IsError = 1) then
- Session("Error") = SecurityBox.ErrorReason
- set SecurityBox = nothing
- Response.Redirect("dsp_websitesecurity.asp?result=0&WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
- end if
- set SecurityBox = nothing
- if (Request.Form("Add") = "Add") then
- Response.Redirect("dsp_websitesecuritydetail.asp?WebSiteName="&Replace(Request.Form("WebSiteName"), " ", "%20"))
- else
- Response.Redirect("dsp_websitesecuritydetail.asp?modify=1&WebSiteName="&Replace(Request.Form("Modify"), " ", "%20"))
- end if
- elseif (Request.Form("Logout") = "Logout") then
- Session("Index") = ""
- Session("Error") = ""
- Response.Redirect("index.asp")
- else
- Response.Redirect("index.asp")
- end if
- %>